<%@ page import="com.actimind.actitime.beans.UserBean,
                 com.actimind.actitime.Keys,
                 com.actimind.actitime.calendar.CalendarLayout,
                 com.actimind.actitime.calendar.CalendarLayout"%><%@ page errorPage="/error.jsp" %>
<%@ taglib uri="/WEB-INF/at.tld" prefix="at" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

<html>
  <head>
    <title><bean:write name="title-prefix" scope="application"/> Edit Calendar Preferences</title>
    <link rel="stylesheet" href="../css/at.css" type="text/css">
    <link rel="stylesheet" href="../css/calendar_nn.css" type="text/css">
    <style type="text/css"> @import url("../css/calendar_small.css"); </style>
  </head>
<body bgcolor="#ffffff" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
<jsp:include page="../top.jsp" flush="false">
    <jsp:param name="pageSection" value="administration" />
    <jsp:param name="pageAction" value="editcalprefs" />
</jsp:include>
<html:form scope="session" action="/administration/calprefs.do" method="post">
<input type="hidden" name="submitted" value="1" >
<table cellpadding="2" cellspacing="4" align="center" valign="top" border="0" bgcolor="#ffffff">
    <tr>
         <td colspan="2" class="pagetitle" align="left">
            Calendar Preferences<br>
            <at:errors/>
            <at:messages id="message" message="true"><span class="successmsg"><bean:write name="message"/></span></at:messages>
            <br>
        </td>
    </tr>
    <tr>
        <td colspan="2" class="formblocktitle" align="left">
            Select Calendar Layout <br>
        </td>
    </tr>
    <tr><td align="left" colspan="2"><img src="../img/pixel.gif" width="1" height="4"></td></tr>
    <tr>
        <td align="left"><img src="../img/pixel.gif" width="10" height="1" alt=""></td>
        <td align="left">
            <table cellspacing="2" cellpadding="0" border="0">
                <tr>
                    <td><html:radio property="calendarLayout" value="<%=CalendarLayout.US_WEEK_CODE%>" /></td>
                    <td align="left" class="formfieldtitle">Week starts on Sunday</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                      <table cellspacing="1" cellpadding="8" border="0">
                         <tr>
                          <td align="center" class="calendarWeekendDayHeaderNormal">Sun</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Mon</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Tues</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Wed</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Thur</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Fri</td>
                          <td align="center" class="calendarWeekendDayHeaderNormal">Sat</td>
                        </tr>
                       </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="left"><img src="../img/pixel.gif" width="10" height="1" alt=""></td>
        <td align="left">
            <table cellspacing="2" cellpadding="0" border="0">
                <tr>
                    <td><html:radio property="calendarLayout" value="<%=CalendarLayout.EU_WEEK_CODE%>" /></td>
                    <td align="left" class="formfieldtitle">Week starts on Monday</td>
                </tr>
                <tr>
                    <td>&nbsp;</td>
                    <td>
                      <table cellspacing="1" cellpadding="8" border="0">
                         <tr>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Mon</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Tues</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Wed</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Thur</td>
                          <td align="center" class="calendarWorkingDayHeaderNormal">Fri</td>
                          <td align="center" class="calendarWeekendDayHeaderNormal">Sat</td>
                          <td align="center" class="calendarWeekendDayHeaderNormal">Sun</td>
                        </tr>
                       </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr><td colspan="2" align="left"><img src="../img/pixel.gif" width="20" height="2"></td></tr>
    <tr>
        <td colspan="2" class="formblocktitle"  align="left">
            Specify Default Workday Duration
        </td>
    </tr>
    <tr>
        <td align="left"><img src="../img/pixel.gif" width="10" height="1" alt=""></td>
        <td align="left">
            <table cellspacing="2" cellpadding="0" border="0">
                <tr>
                    <td><html:select property="defaultWorkdayDuration">
                       <%
                           for(int minute = 60; minute <= 24*60; minute+=30)
                            {
                               String hour = new Integer(minute / 60).toString();
                               String minLeft = (minute % 60 == 0) ? "00" : "30";
                       %>
                         <html:option value="<%=new Integer(minute).toString()%>"><%=hour +  ":" + minLeft%></html:option>
                       <%
                            }
                       %>
                        </html:select>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr><td align="left" colspan="2"><img src="../img/pixel.gif" width="1" height="6"></td></tr>
    <tr>
        <td colspan="2" align="center" class="formbuttonpane">
            <table border="0" cellspacing="0" cellpadding="0">
               <tr>
                    <td colspan="3"><img src="../img/pixel.gif" width="774" height="2"></td>
               </tr>
               <tr align="center">
                   <td>&nbsp;</td>
                   <td align="center"><input type="submit" value="Save Changes"></td>
                   <td>&nbsp;</td>
               </tr>
           </table>
        </td>
    </tr>
  </table>
</html:form>
</html>